/* 商品详情页样式 */

/* 消息提示样式 */
.error-msg {
    color: red;
    padding: 10px 15px;
    margin: 10px 0;
    border: 1px solid #ffcccc;
    background-color: rgba(255, 204, 204, 0.3);
    border-radius: 6px;
    font-size: 14px;
}

.success-msg {
    color: #2e7d32;
    padding: 10px 15px;
    margin: 10px 0;
    border: 1px solid #ccffcc;
    background-color: rgba(204, 255, 204, 0.3);
    border-radius: 6px;
    font-size: 14px;
}

.warning-msg {
    color: #8a6d3b;
    padding: 10px 15px;
    margin: 10px 0;
    border: 1px solid #faebcc;
    background-color: rgba(250, 235, 204, 0.3);
    border-radius: 6px;
    font-size: 14px;
}

.info-msg {
    color: #31708f;
    padding: 10px 15px;
    margin: 10px 0;
    border: 1px solid #bce8f1;
    background-color: rgba(188, 232, 241, 0.3);
    border-radius: 6px;
    font-size: 14px;
}

.retry-btn {
    background-color: #337ab7;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 500;
    transition: all 0.3s;
}

.retry-btn:hover {
    background-color: #286090;
    transform: translateY(-2px);
}

/* 商品详情布局 */
.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-image-section {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.product-info-section {
    flex: 1;
    min-width: 300px;
}

/* 商品标题和价格 */
.product-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 107, 107, 0.3);
}

.product-header h3 {
    margin: 0 0 15px 0;
    font-size: 26px;
    color: #333;
    font-weight: 600;
}

.product-price {
    font-size: 28px;
    font-weight: bold;
    color: #ff6b6b;
    display: flex;
    align-items: baseline;
}

.price-symbol {
    font-size: 18px;
    margin-right: 5px;
}

/* 商品图片样式 */
.product-image-container {
    width: 100%;
    height: 350px; /* 固定高度 */
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #888;
    font-size: 18px;
    border-radius: 8px;
    text-align: center;
    flex-direction: column;
}

.no-image-icon {
    font-size: 48px;
    margin-bottom: 10px;
    color: #ccc;
}

/* 商品信息样式 */
.product-info {
    background-color: rgba(249, 249, 249, 0.7);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-row {
    margin-bottom: 15px;
    display: flex;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-row .label {
    font-weight: 600;
    width: 100px;
    color: #555;
}

.info-row .value {
    flex: 1;
    color: #333;
}

.star {
    color: #FFC107;
    font-weight: bold;
}

/* 购买区域样式 */
.buy-section {
    background-color: rgba(249, 249, 249, 0.8);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 0;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.quantity-control label {
    font-weight: 600;
    color: #555;
    margin-right: 10px;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    color: #555;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-control button:hover {
    background-color: #e0e0e0;
}

.quantity-control span {
    font-size: 16px;
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

.buy-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.add-to-cart, .buy-now {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.add-to-cart {
    background-color: #ff9f43;
    color: white;
    flex: 1;
}

.add-to-cart:hover {
    background-color: #ff8f1f;
}

.buy-now {
    background-color: #ff6b6b;
    color: white;
    flex: 1;
}

.buy-now:hover {
    background-color: #ff5252;
}

/* 评价区域样式 */
.reviews-section {
    margin-top: 30px;
}

.reviews-section h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.review-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.review-score {
    color: #FFC107;
    font-weight: bold;
}

.review-date {
    color: #888;
    font-size: 14px;
}

.review-comment {
    color: #333;
    line-height: 1.5;
}

.no-reviews {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-detail-container {
        flex-direction: column;
    }

    .product-image-section,
    .product-info-section {
        max-width: 100%;
    }

    .buy-buttons {
        flex-direction: column;
    }
}

/* 图片加载时的过渡动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.product-image {
    animation: fadeIn 0.5s ease-in-out;
}